/**
 * @author zhengjiachao
 * @since 2017-3-27
 */
ADF.model.InputModel = function(){
    ADF.model.InputModel.superclass.constructor.call(this);
};

ADF.model.InputModel.PROPERTY_TEXT = "text";
ADF.model.InputModel.PROPERTY_INPUTTYPE = "type";

COM.util.defineClass(ADF.model.InputModel, ADF.model.BaseModel,{

    initModel: function() {
        ADF.model.InputModel.superclass.initModel.call(this);
        this.addPropertyDescriptor(new ADF.propertyDescriptor.DefaultPropertyDescriptor(ADF.model.InputModel.PROPERTY_TEXT, "", "", true, "文本"));
        this.addPropertyDescriptor(new ADF.propertyDescriptor.DefaultPropertyDescriptor(ADF.model.InputModel.PROPERTY_INPUTTYPE, "", "", true, "文本样式"));
    },
    setText: function(text) {
        this.setPropertyValue(ADF.model.InputModel.PROPERTY_TEXT, text);
    },
    getText: function() {
        return this.getPropertyValue(ADF.model.InputModel.PROPERTY_TEXT);
    },
    setInputtype: function(type) {
        this.setPropertyValue(ADF.model.InputModel.PROPERTY_INPUTTYPE, type);
    },
    getInputtype: function() {
        return this.getPropertyValue(ADF.model.InputModel.PROPERTY_INPUTTYPE);
    },

    _getModelType : function(){
        return "ADF.model.InputModel";
    },

    _getName : function(){
        return 'input';  
    },

    fillSerializedJson : function(jsonObject){
        jsonObject[ADF.model.InputModel.PROPERTY_TEXT]=this.getPropertyDescriptor(ADF.model.InputModel.PROPERTY_TEXT).serialize();
        jsonObject[ADF.model.InputModel.PROPERTY_INPUTTYPE]=this.getPropertyDescriptor(ADF.model.InputModel.PROPERTY_INPUTTYPE).serialize();
    },

    _deserialize:function (jsonObject) {
        var newProp=null;

        newProp=new AGEF.PropertyDescriptor();
        newProp.deserialize(jsonObject[ADF.model.InputModel.PROPERTY_TEXT]);
        this.propertyDescriptors.put(newProp.getName(),newProp);

        newProp=new AGEF.PropertyDescriptor();
        newProp.deserialize(jsonObject[ADF.model.InputModel.PROPERTY_INPUTTYPE]);
        this.propertyDescriptors.put(newProp.getName(),newProp);
    }
});